find_package(PkgConfig)
pkg_check_modules(PC_LITEHTML litehtml)
unset(LITEHTML_LIBRARIES)
find_path(LITEHTML_INCLUDE_DIRS
    NAMES litehtml.h
    HINTS ${PC_LITEHTML_INCLUDEDIR}
    ${PC_LITEHTML_INCLUDE_DIRS}
)

find_library(LITEHTML_LIBRARIES
    NAMES litehtml
    HINTS ${PC_LITEHTML_LIBDIR}
    ${PC_LITEHTML_LIBRARY_DIRS}
)

#message(FATAL_ERROR "LITEHTML_LIBRARIES=${LITEHTML_LIBRARIES} LITEHTML_INCLUDE_DIRS=${LITEHTML_INCLUDE_DIRS} PC_LITEHTML_VERSION=${PC_LITEHTML_VERSION}")
if(LITEHTML_INCLUDE_DIRS AND LITEHTML_LIBRARIES)
    set(LITEHTML_FOUND TRUE)
    set(LITEHTML_LIBRARY ${LITEHTML_LIBRARIES})
    set(LITEHTML_INCLUDE_DIR ${LITEHTML_INCLUDE_DIRS})
    set(LITEHTML_VERSION ${PC_LITEHTML_VERSION})
endif()

include(FindPackageHandleStandardArgs)
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(LiteHtml REQUIRED_VARS LITEHTML_INCLUDE_DIRS LITEHTML_LIBRARIES 
#	FOUND_VAR LITEHTML_FOUND VERSION_VAR LITEHTML_VERSION)

mark_as_advanced(LITEHTML_LIBRARIES LITEHTML_LIBRARY LITEHTML_INCLUDE_DIRS LITEHTML_INCLUDE_DIR LITEHTML_FOUND)

